From: Juanma Barranquero Date: Fri, 25 Sep 2009 04:46:34 +0000 (+0000) Subject: * bs.el (bs--get-file-name): Use `list-buffers-directory' X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~10304 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=061386b66b131c9b8ab89720d306b9ce735a920c;p=emacs.git * bs.el (bs--get-file-name): Use `list-buffers-directory' when available, instead of hardcoding mode names. Doc fix. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b0a45070495..95aa7019901 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2009-09-25 Juanma Barranquero + * bs.el (bs--get-file-name): Use `list-buffers-directory' + when available, instead of hardcoding mode names. Doc fix. + * menu-bar.el (list-buffers-directory): Add docstring. Make automatically buffer-local. diff --git a/lisp/bs.el b/lisp/bs.el index 0c7a53cf636..54924196bf0 100644 --- a/lisp/bs.el +++ b/lisp/bs.el @@ -1327,13 +1327,12 @@ ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu." (defun bs--get-file-name (start-buffer all-buffers) "Return string for column 'File' in Buffer Selection Menu. This is the variable `buffer-file-name' of current buffer. -If current mode is `dired-mode' or `shell-mode' it returns the -default directory. +If not visiting a file, `list-buffers-directory' is returned instead. START-BUFFER is the buffer where we started buffer selection. ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu." - (propertize (if (member major-mode '(shell-mode dired-mode)) - default-directory - (or buffer-file-name "")) + (propertize (or buffer-file-name + (bound-and-true-p list-buffers-directory) + "") 'mouse-face 'highlight 'help-echo "mouse-2: select this buffer, mouse-3: select in other frame"))